﻿using System;
using System.Collections.Generic;
using System.Text;

namespace AMS.Configuration
{
    public abstract class ViewConfigBase:IViewConfig
    {
        public abstract ViewInfo GetDefaultConfig(string viewName);
        public abstract ViewInfo GetUserConfig(string viewName, string userName);
        public abstract void SaveUserConfig(ViewInfo view);

        /// <summary>
        /// 是否允许cache
        /// </summary>
        private static bool enableCache = true;

        /// <summary>
        /// 是否允许cache默认为是
        /// </summary>
        public static bool EnableCache
        {
            get { return enableCache; }
            set { enableCache = value; }
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="viewName"></param>
        /// <param name="userName"></param>
        /// <returns></returns>
        public ViewInfo GetUserConfigForEdit(string viewName, string userName)
        {
            ViewInfo defaultView = GetDefaultConfig(viewName);
            ViewInfo userView = GetUserConfig(viewName, userName);

            // TODO: 添加实现

            throw new NotImplementedException();
        }

    }
}
